a=list()
a=[7,1,2,3,8,4,5,6]
dp1=[a[0],0,0,0,0,0,0,0]
dp2=[0,0,0,0,0,0,0,0]
for i in range(len(a)):
    dp1[i] = a[i] + dp2[i-1]
    dp2[i] = max(dp2[i-1], dp1[i-1])
print(dp1)
print(dp2)